//
//  UILabel+Extension.swift
//  Weibo02
//
//  Created by teacher on 16/4/16.
//  Copyright © 2016年 teacher. All rights reserved.
//

import UIKit


extension UILabel {
    
    convenience init(textColor: UIColor, fontSize: CGFloat, preferredMaxLayoutWidth: CGFloat = 0) {
        self.init()
        self.textColor = textColor
        self.font = UIFont.systemFontOfSize(fontSize)
        
        if preferredMaxLayoutWidth > 0 {
            // 设置最大的约束宽度
            self.preferredMaxLayoutWidth = preferredMaxLayoutWidth
            // 设置多行
            self.numberOfLines = 0
        }
    }
}
